﻿using System;
using System.Net.DnsToolkit.Packet.Records;

namespace System.Net.DnsToolkit.Packet.Busy {
    /// <summary>
    /// 
    /// All RRs have the same top level format shown below:
    /// 
    ///                                     1  1  1  1  1  1
    ///       0  1  2  3  4  5  6  7  8  9  0  1  2  3  4  5
    ///     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    ///     |                                               |
    ///     /                                               /
    ///     /                      NAME                     /
    ///     |                                               |
    ///     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    ///     |                      TYPE                     |
    ///     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    ///     |                     CLASS                     |
    ///     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    ///     |                      TTL                      |
    ///     |                                               |
    ///     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    ///     |                   RDLENGTH                    |
    ///     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|
    ///     /                     RDATA                     /
    ///     /                                               /
    ///     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    ///     
    /// </summary>
    public class RR : IRR {

        /// <summary>
        /// an owner name, i.e., the name of the node to which this
        /// resource record pertains.
        /// </summary>
        public IDomainName Name { get; set; }

        /// <summary>
        /// two octets containing one of the RR TYPE codes.
        /// </summary>
        public QTypeEnum RRType { get; set; }

        /// <summary>
        /// two octets containing one of the RR CLASS codes.
        /// </summary>
        public QClassEnum RRClass { get; set; }

        /// <summary>
        /// a 32 bit signed integer that specifies the time interval
        /// that the resource record may be cached before the source
        /// of the information should again be consulted.  Zero
        /// values are interpreted to mean that the RR can only be
        /// used for the transaction in progress, and should not be
        /// cached.  For example, SOA records are always distributed
        /// with a zero TTL to prohibit caching.  Zero values can
        /// also be used for extremely volatile data.
        /// </summary>
        public UInt32 Ttl { get; set; }

        /// <summary>
        /// an unsigned 16 bit integer that specifies the length in
        /// octets of the RDATA field.
        /// </summary>
        public UInt16 RDLength { get; set; }

        /// <summary>
        /// a variable length string of octets that describes the
        /// resource.  The format of this information varies
        /// according to the TYPE and CLASS of the resource record.
        /// </summary>
        public IRecord RData { get; set; }         // public byte[] RData;
        
        
    }


}
